using System;
using System.Collections;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;

using WHC.Hotel.Entity;
using WHC.Hotel.IDAL;
using WHC.Pager.Entity;

namespace WHC.Hotel.BLL
{
	public class Book : BaseBLL<BookInfo>
    {
        public Book() : base()
        {
        }

        public List<BookInfo> FindByRoomNo(string roomNo)
        {
            string condition = string.Format("RoomNo='{0}' and (IsCancel is null or IsCancel=0) ", roomNo);
            return baseDal.Find(condition);
        }

        public List<BookInfo> FindTeamBookList(string bookNo)
        {
            string condition = string.Format("BookNo='{0}' ", bookNo);
            return baseDal.Find(condition);
        }


        public List<BookInfo> FindBookByCondition(string strcondition)
        {
            string condition = string.Format("  {0}   and (IsCancel is null or IsCancel=0) ", strcondition);
            return baseDal.Find(condition);
        }
        public bool UpdateBookIn(int id, int status)
        {
  
            IBook dal = baseDal as IBook;
            return dal.UpdateBookIn(id, status);
        }

        public bool UpdateTeamBook(string bookNum, int status)
        {


            IBook dal = baseDal as IBook;
            return dal.UpdateTeamBook(bookNum, status);

        }

        public bool DelTeamBook(string bookNum)
        {


            IBook dal = baseDal as IBook;
            return dal.DelTeamBook(bookNum);

        }


    }
}
